import java.util.ArrayDeque;
import java.util.LinkedList;
import java.util.Queue;

public class QUeue {
    public static void main1(String[] args) {
        Queue<Integer> queue = new LinkedList<>();
        LinkedList<Integer> linkedList = new LinkedList<>();
        queue.offer(1);//插入
        queue.offer(2);
        queue.offer(3);
        queue.offer(4);
        queue.offer(5);
        System.out.println(queue.peek());//获取对头元素  1
        System.out.println(queue.poll());// 出队 1
        System.out.println(queue.peek());//获取对头元素  2
    }

    public static void main(String[] args) {
        MyQueue myQueue = new MyQueue();
        myQueue.offer(1);
        myQueue.offer(2);
        myQueue.offer(3);
        myQueue.offer(4);
        myQueue.poll();
        myQueue.poll();
        myQueue.poll();
        myQueue.poll();
        myQueue.poll();
        myQueue.poll();
        System.out.println(myQueue.poll());
    }
}
